import query from '@dfeidao/atom-nodejs/db/query';
import log from '@dfeidao/atom-nodejs/logger/log';
import { systemid } from '../../atom/config';
interface Message {
	filter: {
		[key: string]: string
	};
	page_no: number;
}
interface dd {
	v?: string;
}



export default async function atom(msg: Message, action_id: string, session_id: string) {
	log(`Service begin`);
	// todo 查询'设备设施种类维护'
	const { exec, prepare } = query(action_id, session_id, systemid);
	prepare('equ_fac_maintenance', ['_id', 'productid', 'equip_type_no', 'equip_type_name'], {}, 100, 1, [], []);
	const [rs] = await exec();
	rs.forEach((v: dd) => {
		v.v = JSON.stringify(v);
	});

	log(`Service end`);
	return rs;
}
